While executing any sequence of software instructions, a data processor uses a program counter to indicate a program address of an instruction to be executed. The program counter is typically either incremented or decremented to provide a program address of a next instruction. While the program counter is necessary to operation of the data processor, the circuitry required to implement the counter often requires a significant amount of surface area in the execution unit of the data processor.
In most data processors, the program counter must be able to increment at least a sixteen bit number. Generally, the program counter is divided into a high byte and a low byte. The high byte of the program counter either increments or decrements a high byte of a program address value. Similarly, the low byte of the program counter either increments or decrements a low byte of the program address value. If a carry or borrow is generated by the modification of the low byte of the program address value., the carry is propagated to the high byte of the program counter to be respectively incremented or decremented in a final result. Once the final result is generated, each of the high and low bytes of the final result is respectively stored in either a high byte and a low byte register.
While sixteen bit program counters result in efficient execution of software instructions, the area required to implement a sixteen bit incrementer often prohibits the inclusion of additional desired features in data processors having a low cost architecture. Therefore, a need exists for a system or method for incrementing or decrementing a program counter value in a data processor which requires less circuit area than conventional implementations. The system or method should also modify the program counter value quickly and inexpensively.